home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1999 Spring / macformat-077.iso / Shareware Plus / Development / SpriteWorld 2.2 / SpriteWorld Examples / Shark Attack / Sources & Headers / Stats.h < prev   
Encoding:
Text File  |  1997-09-30  |  2.1 KB  |  61 lines  |  [TEXT/CWIE]

  1. ///--------------------------------------------------------------------------------------
  2. // Stats.h
  3. ///--------------------------------------------------------------------------------------
  4.  
  5. #ifndef __SPRITEWORLD__
  6. #include "SpriteWorld.h"
  7. #endif
  8.  
  9.  
  10. ///--------------------------------------------------------------------------------------
  11. // Definitions
  12. ///--------------------------------------------------------------------------------------
  13.  
  14. #define kStatsHeight            40    // Height of stats area
  15. #define kLivesNumOffset            73    // Distance from left side of box to first number
  16. #define kLevelNumOffset            75    // Distance from left side of box to first number
  17. #define kScoreNumOffset            78    // Distance from left side of box to first number
  18. #define kStatsVertOffset        9    // Distance from top of each stats box to each number
  19.  
  20. #define kNumberWidth            13        // How wide each digit is
  21. #define kNumberHeight            13        // How tall each digit is
  22.  
  23. #define kLivesPictResID            130        // Resource IDs for the stats graphics
  24. #define kLevelPictResID            131
  25. #define kScorePictResID            132
  26. #define kNumbersPictResID        133
  27.  
  28.  
  29. typedef enum
  30. {
  31.     kRightJustify = 0,
  32.     kLeftJustify
  33. } JustifyType;
  34.  
  35.  
  36.     // This structure is used for each stats box to tell the digit-drawing
  37.     // routines where to draw the numbers, and what number to draw.
  38. typedef struct
  39. {
  40.     FramePtr    theFrameP;        // pointer to the destination frame
  41.     long        theNum;            // the number to draw
  42.     long        oldNum;            // the number from the previous frame
  43.     short        numDigits;        // how many digits can fit in the box
  44.     short        horizLoc;        // top-left coordinates of where to draw the number
  45.     short        vertLoc;        // top-left coordinates of where to draw the number
  46.     JustifyType justification;
  47. } StatsRec, *StatsRecPtr;
  48.  
  49.  
  50. ///--------------------------------------------------------------------------------------
  51. // Function Prototypes
  52. ///--------------------------------------------------------------------------------------
  53.  
  54. void    InitStats( void );
  55. void    DrawPictInStatsArea( short pictID );
  56. void    UpdateStatsArea( void );
  57. void    UpdateStatsNumbers( void );
  58. void    ResetStats( void );
  59. void    UpdateStatsRec( StatsRecPtr statsRecP );
  60.  
  61.